using System;
using System.Globalization;
using System.IO;
using System.Windows.Data;

namespace CPlatePrintSys.Win.Converters
{
    /// <summary>
    /// 标注图纸路径转换器
    /// 用于检查文件是否存在，返回布尔值用于样式触发器
    /// </summary>
    public class AnnotationDrawingPathConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string path && !string.IsNullOrEmpty(path))
            {
                return File.Exists(path);
            }
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
